Ext.define("SHApp.CompanyManage.AgentInfo.Form", {
    extend: "BLBTSystem.Form",
    requires: ["SHApp.System.AdministrativeArea.AreaCmbTree"],
    submitUrl: "api/agentInfo?format=json",
    txtAreaID: "_txtAreaID",
    winWidth: 665,
    winHeight: 265,
    initComponent: function () {
        var me = this;
        Ext.apply(this);
        me.txtAreaID += me.id;
        this.createItems();
        this.callParent(arguments);
    },
    createItems: function () {
        var me = this;
        this.items = [{
            width: 300,
            border: false,
            bodyStyle: "background:#DFE9F6",
            layout: { type: "vbox", align: "stretch" },
            items: [{
                xtype: "textfield",
                fieldLabel: "ID",
                name: "Id",
                hidden: true
            }, {
                fieldLabel: "<span style='color:red'>*</span>企业名称",
                allowBlank: false,
                blankText: "请输入企业名称！",
                xtype: "textfield",
                name: "ChineseFullName",
                maxLength: 50
            }, {
                fieldLabel: "<span style='color:red'>*</span>地区",
                allowBlank: false,
                blankText: "请选择地区！",
                xtype: "areacmbtree",
                name: "AreaCode",
                maxLength: 50,
                listeners: {
                    select: function (cmb, rs, opt) {
                        if (rs != null) {
                            me.down("#" + me.txtAreaID).setValue(cmb.getTextValue());
                        }
                    }
                }
            }, {
                xtype: "textfield",
                fieldLabel: "地区名称",
                name: "Area",
                id: this.txtAreaID,
                hidden: true
            }, {
                fieldLabel: "工商注册号",
                xtype: "textfield",
                name: "BankNumber",
                maxLength: 50
            }, {
                fieldLabel: "注册地",
                xtype: "textfield",
                name: "RegisterRoom",
                maxLength: 50
            }, {
                fieldLabel: "公司所在地",
                xtype: "textfield",
                name: "CompanyPlace",
                maxLength: 50
            }, {
                fieldLabel: "办公所在地",
                xtype: "textfield",
                name: "WorkPlace",
                maxLength: 50
            }]
        }, {
            width: 300,
            border: false,
            bodyStyle: "background:#DFE9F6",
            layout: { type: "vbox", align: "stretch" },
            items: [{
                fieldLabel: "性质",
                xtype: "textfield",
                name: "Property",
                maxLength: 50
            }, {
                fieldLabel: "规模",
                xtype: "numberfield",
                name: "Scope",
                maxLength: 50
            }, {
                fieldLabel: "上级单位",
                xtype: "textfield",
                name: "HigherUnit",
                maxLength: 50
            }, {
                fieldLabel: "主页",
                xtype: "textfield",
                name: "HomePage",
                maxLength: 50
            }, {
                fieldLabel: "备注",
                xtype: "textareafield",
                name: "Remark",
                maxLength: 200,
                rows: 3,
                cols: 50
            }]
        }];
    }
});